package cn.tedu.rabbitmqspring.m1;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Producer {

    //RabbitAutoConfiguration 自动配置类中，自动创建 AmqpTemplate 实例
    @Autowired
    private AmqpTemplate t;

    //生产者的发送方法，需要手动调用
    public void send(){
        t.convertAndSend("helloworld111","hello worldε＝ε＝ε＝(#>д<)ﾉ");
    }
}
